--- <distance id="5907" function="script" script="slingshot.lua"/>
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
--- attack 10
	local ammo = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
	if ammo.itemid ~= 1294 then --- small stone
		doPlayerSendCancel(cid, "You don't have a small stone.")
		return 0 -- // nil false 0 -1
	end
	doRemoveItem(ammo.uid, 1)
	
	return doCombat(cid, combat, var)
end